﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FilStartUps.FILAPI;

namespace FilStartUps.Controls
{
    public partial class FilStartUps_Post : System.Web.UI.UserControl
    {
        public void GetPost(int postidPK)
        {
            try
            {
                var post = FilStartUpsAPI.GetPostDetails(postidPK);
                posttitle.Text = post.posttitle;
                postdescription.Text = post.postdescription;
                lbcatidFK.Text = post.catidFK.ToString();

            }
            catch (Exception)
            {

            }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int postidPK_ = Convert.ToInt32(Request.QueryString["p"].Trim());
                GetPost(postidPK_);
            }
        }

        protected void lbpostArchieves_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/ArticleArchieves.aspx?c=" + lbcatidFK.Text);
        }
    }
}